<table class="table table-striped table-bordered">
  <thead>
    <tr>
      <th><%= t(".title")%></th>
      <th><%= t(".status")%></th>
      <th><%= t(".author")%></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% @posts.each do |post|%>
      <tr>
        <td><%= link_to post.title, edit_admin_post_path(post) %></td>
        <td><span class="label label-<%= post.published ? "success" : "important" %>"><%= post.published ? t(".published") : t(".not_published") %></span></td>
        <td><span><%= post.user.name %></span> </td>
        <td><%= link_to t(".edit"), edit_admin_post_path(post), class: "btn btn-small" %></td>
        <td><%= link_to t(".delete"), [:admin, post],data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-small btn-danger" %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<% if @page %>
  <%= render partial: "pagination" %>
<% end %>